
<%@page import="entity.User"%>
<%@page import="model.Action"%>
<%@page import="entity.DVPT"%>
<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%
  User user=new User();
    user.setIdUser((String)session.getAttribute("idUser"));
    user.select();
    DVPT dvpt= new  DVPT();
    ResultSet rs=dvpt.selectDB();
            if (user!=null) {

%>
<p>&nbsp;</p>
<p class="titleU">THÔNG TIN CÁ NHÂN</p>
<p>&nbsp;</p>
<div class="divlon">
  <form id="form1" name="form1" method="post" action="/quanlyphonghoc/edituser">
    <input name="idUser" type="hidden" value="<%=user.getIdUser() %>" />
      <table width="547" border="1" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="145" height="25" align="right" valign="middle"><strong>Họ và Tên&nbsp;</strong></td>
    <td width="396" align="left" valign="top"><label>
            <input name="name" type="text" id="name" value="<%= Action.converToHTML( user.getName()) %>" size="50" />
          </label></td>
        </tr>
        <tr>
          <td height="25" align="right" valign="middle"><strong>Ngày Sinh &nbsp; </strong></td>
          <td align="left" valign="top"><input type="text" name="birthday" id="birthday" onClick="return showCalendar('birthday', '%d-%m-%Y');" value="<%=Action.converDatetoSite(user.getBirthday())%>" size="43"
><input type="reset" value=" ... " onclick="return showCalendar('birthday', '%d-%m-%Y');">
        </tr>
        <tr>
          <td height="25" align="right" valign="middle"><strong>Giới Tính &nbsp; </strong></td>
          <td align="left" valign="top">&nbsp;
        
            <label>
                <input name="sex" type="radio" id="sex_0" value="1" <%if(Integer.parseInt(user.getSex())==1){ %> checked="checked" <%} %>/>
              Nam</label>
            <label>
              <input type="radio" name="sex" value="0" id="sex_1" <%if(Integer.parseInt(user.getSex())==0){ %> checked="checked" <%} %>/>
              Nữ</label>
            <br />
          </td>
        </tr>
        <tr>
          <td height="25" align="right" valign="middle"><strong>E-Mail &nbsp; </strong></td>
          <td align="left" valign="top"><input name="email" type="text" id="email" value="<%=user.getEmail()%>" size="50"/></td>
        </tr>
        <tr>
          <td height="25" align="right" valign="middle"><strong>Số Điện Thoại &nbsp; </strong></td>
          <td align="left" valign="top"><input name="phone" type="text" id="phone" value="<%=user.getPhone()%>" size="50" /></td>
        </tr>
        <tr>
          <td height="25" align="right" valign="middle"><strong>Đơn Vị Phụ Trách &nbsp;</strong></td>
          <td align="left" valign="top"><label>
          <select name="dvpt" id="dvpt">
              
              <% while(rs.next()){ %>
              <option value="<%=rs.getString("iddvpt") %>" <%if(rs.getString("iddvpt")==user.getIddvpt()){ %>selected="selected" <%}%> > <%=rs.getString("TenDV")  %></option>
            <%}%>
          </select>
          </label></td>
        </tr>
        <tr>
          <td height="25" align="right" valign="middle"><strong>Đơn Vị Công Tác &nbsp; </strong></td>
          <td align="left" valign="top"><input name="dvct" type="text" id="dvct" value="<%=user.getDvct()%>" size="50"/></td>
        </tr>
        <tr>
          <td height="25" align="right" valign="middle"><strong>Nghề Nghiệp &nbsp; </strong></td>
          <td align="left" valign="top"><input name="job" type="text" id="job" value="<%=user.getJob()%>" size="50"/></td>
        </tr>
        <tr>
          <td height="25" align="right" valign="middle"><strong>Địa Chỉ &nbsp; </strong></td>
          <td align="left" valign="top"><input name="address" type="text" id="address" value="<%=user.getAddress()%>" size="50" /></td>
        </tr>
      </table>
      <br />
      <br />      
      <div align="center">
        <input type="submit" name="chinhsua" id="chinhsua" value="Chỉnh Sửa" />
</div>
  </form>
  <p>&nbsp;</p>
</div>
<br />
<p>&nbsp;</p>
<% } else {%>
<p>Xuất hiện lỗi yêu cầu xem lại các thao tác.</p>
<%}%>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>